package com.example.codereview;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.editor.Editor;

/**
 * @author xianfeng
 * @date 2024/11/7 18:57
 * @description:
 */
public class CustomDefaultActionGroup extends DefaultActionGroup {


    @Override
    public void update(AnActionEvent event) {
        // Enable/disable depending on whether a user is editing
        Editor editor = event.getData(CommonDataKeys.EDITOR);
        event.getPresentation().setEnabled(editor != null);
    }
}
